<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
		<script src="js/mock.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/database.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="css/getcoupon.css" />
	</head>
	<body>
		<header>
			<img src="img/back.svg" class="back" id="back">
			<h1 class="mui-title">我的优惠券</h1>
			<img src="img/top-chose.png" class="header-right">
		</header>
		<div id="tab">
			<ul id="tabul" class="space-between">
				<li class="active">待使用</li>
				<li>已使用</li>
			</ul>
		</div>
		<div id="coupon">
			<img src="img/coupon-img.png" >
			<img src="img/coupon-img.png" >
		</div>
	</body>
	<script src="js/resultbank.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		function tab(){
			var tab=document.getElementById('tabul');
			var tabli = tab.getElementsByTagName('li');
			var box = document.getElementById('coupon');
			var main = box.getElementsByTagName('img');
			var n=0;
			
			for(var i = 0; i< tabli.length ; i++){
				tabli[i].index= i;
				tabli[i].onclick = function(){
					this.classList.add('active');
					main[this.index].style.display='block';
					main[this.index].classList.add('active')
					tabli[n].classList.remove('active');
					main[n].style.display='none';
					main[n].classList.remove('active');
					n=this.index
				}
			}
		}
		tab()
	</script>
</html>
